package com.frank.im.base;

import java.util.ArrayList;

import com.frank.im.utils.MarkUtil;
import com.frank.im.utils.Logger;

/**
 * im通讯数据管理
 * 
 * @author Frank
 * @version 1.0 Create by 2016.4.11
 */
public class ImChatManage {
	private final static String TAG = ImChatManage.class.getSimpleName();
	private static ImChatManage dbMg = new ImChatManage();
	private ArrayList<ImEventListener> eventListeners = new ArrayList<ImEventListener>();
	private MarkUtil markUtil = null;

	private ImChatManage() {
	}

	public synchronized static ImChatManage getInstance() {
		return dbMg;
	}

	public void registerEventListener(ImEventListener eventListener) {
		Logger.i(TAG, eventListener.toString());
		eventListeners.add(eventListener);
	}

	public void unregisterEventListener(ImEventListener eventListener) {
		Logger.i(TAG, eventListener.toString());
		eventListeners.remove(eventListener);
	}

	public ArrayList<ImEventListener> getEventListeners() {
		return eventListeners;
	}
	
	public MarkUtil getAppMarkUtil() {
		return markUtil;
	}

	public void setAppMarkUtil(MarkUtil markUtil) {
		this.markUtil = markUtil;
	}
}
